<?php
class fwLoginTt
{
	private static $service = null;
	private static $sourceCompany = null;
	private static $sourceApplication = null;
	private static $sourceVersion = null;

	private static $loaded = false;

	public static function processLogin($datas)
	{
		global $conf;
		$login  = (isset($datas['login'])?$datas['login']:'');
		$password = (isset($datas['password'])?$datas['password']:'');
		if($login=='' || $password=='')
		{
			return array(false, '');
		}
		$sql = 'SELECT
			ua_i_id
		FROM
			'.$conf['bdd']['prefix'].'user_auth
		WHERE
			ua_s_login=\''.addslashes($login).'\'
			AND ua_s_password=\''.addslashes($password).'\'
			AND ua_d_deleted IS NULL';
		$ua_id = fwDb::getCell($sql);
		if($ua_id!==false)
		{
			return array(true, $ua_id);
		}
		return array(false, '');
	}
}
?>